﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="CPUPercentage" targetNamespace="http://tempuri.org/CPUPercentage.xsd" xmlns:mstns="http://tempuri.org/CPUPercentage.xsd" xmlns="http://tempuri.org/CPUPercentage.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="SQLServerOptimizerConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="SQLServerOptimizerConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.SQLServerOptimizer.PL.WPF.Properties.Settings.GlobalReference.Default.SQLServerOptimizerConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="CPUPercentageTableAdapter" GeneratorDataComponentClassName="CPUPercentageTableAdapter" Name="CPUPercentageTable" UserDataComponentName="CPUPercentageTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="SQLServerOptimizerConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="false" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="false" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT        Performance.PerfServer.Name, Performance.Time.Time, AVG(Performance.CpuUsage.Percentage) AS Value, Performance.Trace.TraceID
FROM            Performance.PerfServer INNER JOIN
                         Performance.CpuCore ON Performance.PerfServer.PerfServerID = Performance.CpuCore.PerfServerID INNER JOIN
                         Performance.CpuUsage INNER JOIN
                         Performance.Time ON Performance.CpuUsage.TimeID = Performance.Time.TimeID INNER JOIN
                         Performance.Trace ON Performance.Time.TraceID = Performance.Trace.TraceID ON Performance.CpuCore.CpuCoreID = Performance.CpuUsage.CoreID
WHERE        (@TraceID = Performance.Trace.TraceID) AND (@Server = Performance.PerfServer.PerfServerID)
GROUP BY Performance.PerfServer.Name, Performance.Time.Time, Performance.Trace.TraceID</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="TraceID" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="Int32" Direction="Input" ParameterName="@TraceID" Precision="0" ProviderType="Int" Scale="0" Size="1024" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="Server" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="Int32" Direction="Input" ParameterName="@Server" Precision="0" ProviderType="Int" Scale="0" Size="1024" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Name" DataSetColumn="Name" />
              <Mapping SourceColumn="Time" DataSetColumn="Time" />
              <Mapping SourceColumn="Value" DataSetColumn="Value" />
              <Mapping SourceColumn="TraceID" DataSetColumn="TraceID" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="CPUPercentage" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="CPUPercentage" msprop:Generator_UserDSName="CPUPercentage">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="CPUPercentageTable" msprop:Generator_TableClassName="CPUPercentageTableDataTable" msprop:Generator_TableVarName="tableCPUPercentageTable" msprop:Generator_TablePropName="CPUPercentageTable" msprop:Generator_RowDeletingName="CPUPercentageTableRowDeleting" msprop:Generator_RowChangingName="CPUPercentageTableRowChanging" msprop:Generator_RowEvHandlerName="CPUPercentageTableRowChangeEventHandler" msprop:Generator_RowDeletedName="CPUPercentageTableRowDeleted" msprop:Generator_UserTableName="CPUPercentageTable" msprop:Generator_RowChangedName="CPUPercentageTableRowChanged" msprop:Generator_RowEvArgName="CPUPercentageTableRowChangeEvent" msprop:Generator_RowClassName="CPUPercentageTableRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnPropNameInTable="NameColumn" msprop:Generator_UserColumnName="Name" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="4000" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Time" msprop:Generator_ColumnVarNameInTable="columnTime" msprop:Generator_ColumnPropNameInRow="Time" msprop:Generator_ColumnPropNameInTable="TimeColumn" msprop:Generator_UserColumnName="Time" type="xs:dateTime" minOccurs="0" />
              <xs:element name="Value" msdata:ReadOnly="true" msprop:Generator_ColumnVarNameInTable="columnValue" msprop:Generator_ColumnPropNameInRow="Value" msprop:Generator_ColumnPropNameInTable="ValueColumn" msprop:Generator_UserColumnName="Value" type="xs:int" minOccurs="0" />
              <xs:element name="TraceID" msdata:ReadOnly="true" msdata:AutoIncrement="true" msdata:AutoIncrementSeed="-1" msdata:AutoIncrementStep="-1" msprop:Generator_ColumnVarNameInTable="columnTraceID" msprop:Generator_ColumnPropNameInRow="TraceID" msprop:Generator_ColumnPropNameInTable="TraceIDColumn" msprop:Generator_UserColumnName="TraceID" type="xs:int" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>